<?php
namespace Admin\Controller;
use Common\Controller\CoreController;


/**
 * Created by IntelliJ IDEA.
 * User: fanxu(746439274@qq.com)
 * Date: 15/7/6
 * Time: 下午11:51
 */

class LoginController extends CoreController{

    protected function _initialize(){
        parent::_initialize();
        layout(false);
    }
    public function index(){
        $this->display();
    }
    public function login(){
        $backUrl = __SITE__ . 'Admin/Index/index.html';
        if( isset( $_SERVER['HTTP_REFERER'] )
            && !empty( $_SERVER['HTTP_REFERER'] )
            && strpos( $_SERVER['HTTP_REFERER'] , 'Login' ) === false

        ){
            $backUrl = $_SERVER['HTTP_REFERER'];
        }
        return $this->jsonReturn([
            'url' => $backUrl
        ]);
    }

}